<?php

if(isset($_POST['email']) && $_POST['email']!==null) {

$f = fopen('emails.txt', 'a');
fwrite($f, $_POST['email'] . "\r\n");
fclose($f);

}

header('Location:index.php');

?>